<?php

namespace app\api\validate;

use think\Validate;

class Source extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'phone'        => 'require|mobile',
        'company_name'       => 'require',
    ];

    /**
     * 提示消息
     */
    protected $message = [
        'company_name.require'         => '公司名称不能为空',
        'phone.require'        => '手机号不能为空',
        'phone.mobile'         => '手机号格式不正确',
    ];

    /**
     * 验证场景
     */
    protected $scene = [
        'add'  => ['phone', 'company_name'],
        'edit' => ['phone', 'company_name'],
    ];

}
